Skip to content

Conversation

@steinkobben
Copy link
Contributor

@steinkobben steinkobben commented Oct 29, 2025

HTM-1438 Powered by Pull Request Badge

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Test Results

  1 files  ±0  215 suites  ±0   8m 53s ⏱️ -7s
532 tests ±0  532 ✅ ±0  0 💤 ±0  0 ❌ ±0 
618 runs  ±0  618 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit e974af9. ± Comparison against base commit 1196e29.

♻️ This comment has been updated with latest results.

@mprins mprins requested a review from Copilot October 30, 2025 10:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the task deletion and scheduling functionality in the search index management system. The changes convert TaskMonitoringService to a root-level singleton service and improve the handling of schedule deletions.

Key changes:

  • Converted TaskMonitoringService from component-level to root-level singleton service
  • Implemented automatic task deletion when removing a search index schedule
  • Enabled the "No schedule" option in the UI that was previously disabled

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
projects/shared/src/lib/components/slider/slider.component.ts Removed debug console statement
projects/admin-core/src/lib/tasks/task-details/task-details.component.ts Removed service from component providers, fixed method name to follow naming convention
projects/admin-core/src/lib/tasks/services/task-monitoring.service.ts Changed service to root-level singleton, renamed method to follow RxJS naming convention
projects/admin-core/src/lib/search-index/services/search-index.service.ts Added logic to delete associated tasks when removing schedules, imported required dependencies
projects/admin-core/src/lib/search-index/search-index-scheduling/search-index-scheduling.component.ts Simplified schedule object creation to always build schedule object
projects/admin-core/src/lib/search-index/search-index-scheduling/search-index-scheduling.component.html Removed disabled state from "No schedule" option
projects/admin-core/src/lib/search-index/search-index-edit/search-index-edit.component.ts Added task loading on component initialization
Comments suppressed due to low confidence (1)

projects/admin-core/src/lib/tasks/services/task-monitoring.service.ts:78

  • The method dispatches deleteTaskSuccess with this.uuid$.value instead of the uuid parameter passed to the method. Since TaskMonitoringService is now a root-level singleton used by multiple components, this.uuid$.value may contain a different task UUID than the one being deleted. Use the uuid parameter instead: deleteTaskSuccess({ taskUuid: uuid }).
            this.store$.dispatch(deleteTaskSuccess({ taskUuid: this.uuid$.value }));

Comment on lines 68 to 73
const schedule = {
...this.taskSchedule,
cronExpression: value.cronExpression || '',
description: value.description,
priority: value.priority,
};
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schedule object is now always created even when cronExpression is empty. This changes the behavior from emitting undefined to emitting a schedule object with an empty cronExpression. This could cause issues in the parent component logic that checks for schedule existence. Consider preserving the original behavior where schedule is set to undefined when cronExpression is empty.

Suggested change
const schedule = {
...this.taskSchedule,
cronExpression: value.cronExpression || '',
description: value.description,
priority: value.priority,
};
let schedule: TaskSchedule | undefined;
if (value.cronExpression && value.cronExpression.trim() !== '') {
schedule = {
...this.taskSchedule,
cronExpression: value.cronExpression,
description: value.description,
priority: value.priority,
};
} else {
schedule = undefined;
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steinkobben this seems a valid concern, see also: #1044 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a check that prevents creating new schedules if the cron expression is empty. When there is an existing schedule, the schedule should be emitted with an empty cron expression because the parent component needs the schedule uuid to delete the task.

Copy link

Copilot AI commented Oct 30, 2025

@mprins I've opened a new pull request, #1047, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

@mprins mprins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments/questions; the logic as such (delete the task if the schedule is set to null / undefined) is valid for indexing tasks because these are always scheduled using a cron expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants